import {
  createRouter,
  createWebHashHistory,
  type RouteRecordRaw,
} from "vue-router";
import HelloWorld from "../views/HelloWorld.vue";
import Layout from "../layout/Index.vue";

export const routes: Array<RouteRecordRaw> = [
  { path: "/", redirect: "/runtime", meta: { title: "" } },
  {
    path: "/runtime",
    component: Layout,
    meta: { title: "runtime实时数据" },
    children: [
      { path: "/test", component: HelloWorld, meta: { title: "test环境" } },
      {
        path: "/product",
        component: HelloWorld,
        meta: { title: "product环境" },
      },
      { path: "/pre", component: HelloWorld, meta: { title: "pre环境" } },
    ],
  },
  {
    path: "/pprof",
    component: Layout,
    meta: { title: "pprof数据" },
    children: [
      {
        path: "/goroutine",
        component: HelloWorld,
        meta: { title: "goroutine数据" },
      },
      {
        path: "/heap",
        component: HelloWorld,
        meta: { title: "heap数据" },
      },
    ],
  },
];
export default createRouter({
  history: createWebHashHistory(),
  routes,
});
